<!--  -->
<template>
  <div class="">
    <a-modal :footer="null" v-model="visible" title="上传文件" @ok="handleOk">
      <a-form :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
        <a-form-item v-for="(item, index) in items" :key="index" :label="item.label">
          <div style="display:flex" class="">
            <upload-btton style="flex:1" v-on="$listeners" ref="up" :action="item.action"></upload-btton>
            <a :href="item.url">下载模版</a>
          </div>
        </a-form-item>
      </a-form>
    </a-modal>
  </div>
</template>

<script>
import UploadBtton from './uploadBtton.vue'

export default {

  data () {
    return {
      text: '上传文件',
      items: [],
      visible: false,
    }
  },
  components: {
    UploadBtton

  },
  methods: {
    show (items) {
      this.items = items

      this.visible = true
      items.map((item, index) => {
        this.$refs.up[index].clearFile()
      })
    },
    handleOk (e) {
      this.visible = false
    },
  }
}
</script>

<style lang='less' scoped>
</style>